/*
 * @Author: 何丽彬
 * @Email: helibin@yingzi.com
 * @Date: 2021-11-19 09:13:40
 * @LastEditTime: 2021-12-01 16:43:53
 * @LastEditors: 何丽彬
 * @FilePath: \process-learn\cluster\single.js
 */
// 单线程
// console.time('timer');
// let j;

// for(let i = 0;i<6e9;i++) {
//     Math.random();
// }

// console.timeEnd('timer');


function fibonacci(n) {
  if (n == 0 || n == 1) {
    return n;
  } else {
    return fibonacci(n - 1) + fibonacci(n - 2);
  }
}

let startTime = Date.now();
let totalCount = 500;
let completedCount = 0;
let n = 35;

for (let i = 0; i < totalCount; i++) {
  fibonacci(n);
  completedCount++;
  console.log(`process: ${completedCount}/${totalCount}`);
}
console.log("👏 👏 👏 👏 👏 👏 👏 👏 👏 👏");
console.info(`任务完成，用时: ${Date.now() - startTime}ms`);
console.log("👏 👏 👏 👏 👏 👏 👏 👏 👏 👏");
